<template>
  <section :class="[!isSetPageBackground ? 'c-bg-white' : '']">
    <cust-title-com v-if="item.isShowTitle" :headLine="item.styleParam && item.styleParam.headLine ? item.styleParam.headLine : null" :titleName="item.title || '友情链接'" :titleDesc="item.desc" :showMore="1"></cust-title-com>
    <div class="c-ph24 c-pv24" :style="item.styleParam && item.styleParam.marginSettings ? getVerticalSpacing(item.styleParam.marginSettings) + getHorizontalSpacing(item.styleParam.marginSettings) : ''">
      <div class="c-w100 c-contexty-hidden c-contextX-scroll c-ws-n">
        <div v-for="(it,idx) in item.items" :key="idx" @click="clickFirendLink(it)" class="c-inlineblack c-textAlign-c c-ww190 c-maxh120 c-br6 c-text-hidden" :class="idx == item.items.length - 1 ? '':'c-mr20'">
          <img class="c-w100 imgCloseBig c-br6 c-maxh120" :src="$addXossFilter(it.image, require('@/assets/defult270.png'))" alt="" />
        </div>
      </div>
    </div>
  </section>
</template>
<script>
import custTitleCom from "@/components/templates/custIndexTemp/custTitleCom.vue";
import { custIndex } from "@/mixin/custIndex.js";
import { customStyle } from '@/utils/customStyle.js'
export default {
  mixins: [custIndex, customStyle],
  components: {
    custTitleCom,
  },
  props: {
    item: {
      type: Object,
      default: () => {
        return {}
      },
    },
    upgradeMemberJump: {
      type: String,
      default: ''
    },
    pageName: {//首页 INDEX 预览页 PREVIEW_INDEX 微页面 MICRO_PAGE
      type: String,
      default: "INDEX"
    },
  },
  data() {
    return {
      isSetPageBackground: sessionStorage.getItem("isSetPageBackground") || 0
    };
  },
  methods: {
    clickFirendLink(data) {
      if (this.pageName == 'PREVIEW_INDEX') {
        return;
      }
      data.pageName = this.pageName;
      data.upgradeMemberJump = this.upgradeMemberJump;
      this.commonModuleRouterPush(data)
    },
  },
};
</script>